{include file="common/header"}
<div class="content-wrapper">
    {include file="chat/nav"/}
    
         <link rel="stylesheet" type="text/css" href="https://www.layuicdn.com/layui/css/layui.css" />
 <script src="https://www.layuicdn.com/layui/layui.js"></script>
 <script src="https://cdn.bootcss.com/layer/2.3/layer.js"></script>
 
 
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="nav-tabs-custom">
                    {include file="chat/tabs"/}
                    <div class="tab-content">
                        <div class="page-content">
                            <div class="panel panel-info">
                                <div class="panel-heading">
                                    筛选
                                    <span class="pull-right">共有聊天记录&nbsp;<font style="color: red;font-weight: bold;">{$total}</font>&nbsp;条</span>
                                </div>
                                <div class="panel-body">
                                    <form class="form-horizontal" method="get" role="form">
                                    
                                        <div class="form-group">
                                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">用户id</label>
                                            <div class="col-sm-6 col-md-8 col-lg-8 col-xs-12">
                                                <input type="text" class="form-control" name="uid" value="{$_GET['uid']?$_GET['uid']:''}" placeholder="请输入用户id">
                                            </div>
                                        </div>
                               
                         
                                        <div class="form-group">
                                            <div class="col-sm-6 col-md-8 col-lg-8 col-xs-12 col-md-offset-2 col-lg-offset-2 col-sm-offset-4">
                                                <button class="btn btn-primary"><i class="fa fa-search"></i> 搜索</button>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                            <form method="post" class="form-horizontal" id="display_form">
                                <div class="panel panel-default ">
                                    <div class="table-responsive panel-body">
                                        <table class="table table-hover">
                                            <thead class="navbar-inner">
                                            <tr>
                                                <th style="width: 45px">删?</th>
                                                <th>ID</th>
                                                <th>用户ID</th>
                                                <th>昵称</th>

                                                <th>内容</th>
                                                <th>图片</th>
                                                <th>头像</th>
                                                <th>时间</th>
                                        
                                            </tr>
                                            </thead>
                                            <tbody>
                                            {if !empty($list)}
                                                {volist name="list" id="item"}
                                                <tr>
                                                    <td>
                                                        <input type="checkbox" name="ids[]" value="{$item['id']}">
                                                    </td>
                                                    <td>{$item['id']}</td>
                                                    <td>{$item['uid']}</td>
                                                    <td>{$item['nickname']}</td>
                                                    <td>
                                                    {$item['content']}
                                                    </td>
                                                    <td>
                                                                {if $item['img']}
                                                    <img onclick="fangda(this)" style="height:100px;width:100px;" src="{$item['img']}" >
                                                        {/if}
                                                    </td>
                                                     <td>

                                                    <img style="height:100px;width:100px;" src="{$item['avatar']}" >

                                                    </td>
                                                    <td>
                                                        {$item.create_time|date="Y-m-d H:i:s",###}
                                                    </td>
                                                   
                                                </tr>
                                                {/volist}
                                                <tr>
                                                    <td>
                                                        <input type="checkbox" onclick="var ck = this.checked;$('table').find(':checkbox').each(function(){this.checked = ck});">
                                                    </td>
                                                    <td colspan="6">
                                                        <button class="btn btn-sm btn-danger" name="submit" type="button">删除</button>
                                                    </td>
                                                </tr>
                                            {/if}
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </form>
                            {$pager}
                            <script type="text/javascript">
                                $(function () {
                                    $('button[name="submit"]').bind('click',function() {
                                        if (confirm('删除后不可恢复，您确定删除吗？')) {
                                            $.post(
                                                window.location.href,
                                                $('#display_form').serialize(),
                                                function (ret) {
                                                    message(ret.message, ret.redirect, ret.type);
                                                }, 'json'
                                            );
                                        }
                                    });
                                });
                            </script>
                        </div>
                    </div>
                    <!-- /.tab-content -->
                </div>
                <!-- /.nav-tabs-custom -->
            </div>
            <!-- /.col -->
        </div>
    </section>
</div>
<script>
	function fangda(e){
	
		layer.photos({ photos: {"data": [{"src": $(e).attr('src')}]} });
	}
</script>
{include file='common/ufooter'}
